<?php 


/** 
***************************************************
*欢迎使用免费版xSite企业自助建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.php.net.cn/xsite/ 
***************************************************
**/




 header("Content-type: text/html;charset=utf-8"); require_once "php.net.cn/xsite/include/common.inc.php"; require_once "php.net.cn/xsite/include/360_safe3.php"; $setting = cache_read("setting"); extract($setting); unset($password, $domain[$site_url]['password']); if (SITE_REWRITE == FALSE) { $_SERVER['QUERY_STRING'] = preg_replace('/\.html$/i', '', $_SERVER['QUERY_STRING']); if (isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = preg_replace('/^\/\?/i', '/', $_SERVER['REQUEST_URI']); } } else { if (isset($_SERVER['REQUEST_URI']) && preg_match('/\.html$/', $_SERVER['REQUEST_URI']) && file_exists(SITE_DIR . $_SERVER['REQUEST_URI'])) { include SITE_DIR . $_SERVER['REQUEST_URI']; exit(); } } $GETS = empty($_SERVER['QUERY_STRING']) ? "index" : $_SERVER['QUERY_STRING']; $GETS = preg_replace("/[\/]+/", "/", $GETS); $GETS = preg_replace("/[\-]+/", "-", $GETS); $REQUEST_URI = @parse_url( $_SERVER['REQUEST_URI']); if (@array_key_exists('query', $REQUEST_URI) && !empty($REQUEST_URI['query'])) { parse_str($REQUEST_URI['query']); } $cache_dir = SITE_ROOT . "/data/tpl/{$site_url}"; $cache_html_file = "{$cache_dir}/" . md5($GETS) . ".html"; if (file_exists($cache_html_file) && time() - filemtime($cache_html_file) < CACHE_TIME && IN_CACHE) { include $cache_html_file; exit(); } $GETS = explode("/", $GETS); $GET = array(); $viewname = array_shift($GETS); if (count($GETS) >= 1) { foreach($GETS as $v) { $temp = explode('-', $v); $GET[$temp[0]] = isset($temp[1])?$temp[1]:''; } extract($GET); } if (isset($_COOKIE['theme_id']) && !empty($_COOKIE['theme_id']) ) { $skinid = $_COOKIE['theme_id']; } $tpldir = SITE_DIR . "/templates/{$skinid}"; $tplpath = SITE_PATH . "/templates/{$skinid}"; $skinpath = SITE_PATH . "/templates/{$skinid}/images"; $html_file = "./templates/{$skinid}/{$viewname}"; ob_start(); if (file_exists("{$html_file}.htm.php")) { if ($viewname == 'index' && file_exists(SITE_ROOT . "/data/setting/{$site_url}/first.{$skinid}.txt")) { $firstconfig = read_array_file(SITE_ROOT . "/data/setting/{$site_url}/first.{$skinid}.txt"); extract($firstconfig); } if (file_exists(SITE_ROOT . "/data/setting/{$site_url}/style.{$skinid}.txt")) { $tplconfig = read_array_file(SITE_ROOT . "/data/setting/{$site_url}/style.{$skinid}.txt"); extract($tplconfig); } include("{$html_file}.htm.php"); $html = ob_get_clean(); $html = url_rewrite($html); } elseif(file_exists("{$html_file}.htm")) { include("{$html_file}.htm"); $html = ob_get_clean(); $html = url_rewrite($html); } elseif (file_exists("{$html_file}.html")) { include("{$html_file}.html"); $html = ob_get_clean(); $html = url_rewrite($html); } else { if (array_key_exists('REQUEST_URI', $_SERVER) && !empty($_SERVER['REQUEST_URI'])) { $pathinfo = (@parse_url($_SERVER['REQUEST_URI'])); if (@array_key_exists('path', $pathinfo) && !empty($pathinfo['path'])) { if (@file_exists($pathinfo['path']) && is_file($pathinfo['path'])) { include $pathinfo['path']; exit(); } else { echo '<html><body>[A]:没有为该页找到指定的模板文件，请联系技术人员！help@php.net.cn</body></html>'; exit(); } } else { echo '<html><body>[B]:没有为该页找到指定的模板文件，请联系技术人员！help@php.net.cn</body></html>'; exit(); } } else { echo '<html><body>[C]:没有为该页找到指定的模板文件，请联系技术人员！help@php.net.cn</body></html>'; exit(); } } if (CACHE_TIME > 0 && IN_CACHE) { if (!file_exists("{$cache_dir}")) { mkdir("{$cache_dir}"); } if ($fp = @fopen($cache_html_file, "w")) { if (@fwrite($fp, $html)) { @fclose($fp); echo $html; } else { exit(siteteam_sys_msg(3)); } } else { exit(siteteam_sys_msg(3)); } } else { echo $html; } ?>